<template>
  <div class="details">
    <h1 class="title">{{ title }}</h1>

    <ComCard class="AllcontentBox">
      <template #header-left>
        <ul>
          <li v-for="(item, index) in detailList" :key="index">
            <template v-if="item.type === '1'">
              <span v-for="(subIten, index) in item.content" :key="index">{{
                subIten
              }}</span>
            </template>
            <template v-else>
              <el-image
                style="width: 500px"
                :src="item.content"
                :preview-src-list="[item.content]"
              >
              </el-image>
            </template>
          </li>
        </ul>

        <!-- <ul>
          <li v-for="(item, index) in detailList" :key="index">
            <template v-if="item.type === '1'">
              {{ item.content }}
            </template>
            <template v-else>
              <img :src="item.content" alt="" />
            </template>
          </li>
        </ul> -->
        <!-- <div class="laws-update">
          <div class="top">
            <h1 class="title">法规更新二</h1>
            <div class="date">更新时间：2021-0815 14:59:07</div>
          </div>
          <div class="content">
            旧法规：第三百零三条
            【共有物的分割】积极与工商行政管理部门合作，加强对个人转让非上市公司股权所得征管。重点做好平价或低价转让股权的核定工作，建立电子台账，记录股权转让的交易价格和税费情况，强化财产原值管理。
          </div>
        </div> -->
      </template>
    </ComCard>
  </div>
</template>

<script>
import ComCard from "../../../../components/comCard.vue";
import { getDetailByIdInfoApi } from "@/wss/api/lawUpdate.js";

export default {
  components: { ComCard },
  data() {
    return {
      detailList: [],
      title: "",
    };
  },
  mounted() {
    this.getDetailByIdtFn();

    // console.log(this.$route.query);
  },
  methods: {
    async getDetailByIdtFn() {
      console.log(this.$route.query);
      let ret = await getDetailByIdInfoApi({
        id: this.$route.query.id,
      });
      console.log(ret);
      return;
      console.log(data);
      if (code === 200) {
        if (!data) {
          data = {};
        }

        this.detailList = data.info;
        this.title = data.title;
      }
    },
  },
};
</script>
<style lang="scss" scoped>
.details {
  .breadcrumbBox {
    height: 50px;
    line-height: 50px;
  }
  padding: 20px;

  .title {
    font-weight: 900;
    color: #f2bc58;
    text-align: center;
  }
  ul {
    padding: 0px;
    li:last-child {
      height: 40px;
      border-bottom: 2px #ffcc33 solid;
    }
    li {
      list-style: none;
      margin: 20px 0px;
      font-size: 14px;
      img {
        height: 200px;
        width: 200px;
      }
    }
  }
  .AllcontentBox {
    padding-bottom: 50px;
  }
  .laws-update {
    background-color: #f5f5f5;
    padding-bottom: 10px;

    .top {
      display: flex;
      align-items: center;
      h1 {
        margin-right: 30px;
      }
    }
    .content {
      font-size: 13px;
      color: #999999;
    }
  }
}
</style>